package beans;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.beans.VetoableChangeListener;
import java.beans.VetoableChangeSupport;
import java.io.Serializable;
import java.util.Collection;

public class Periode implements Serializable {

	private static final long serialVersionUID = 261908503791215716L;

	private int numPeriode;
	private Jours dateDebut;
	private Jours dateFin;
	private Promotion promotion;
	private Semestre semestre;
	private Collection<Jours> listeJours;
	
	PropertyChangeSupport changeSupport;
	VetoableChangeSupport vetoableSupport;
	
	public Periode() {}
	
	public Periode(int numPeriode, Jours dateDebut, Jours dateFin,
			Promotion promotion, Semestre semestre) {
		super();
		this.numPeriode = numPeriode;
		this.dateDebut = dateDebut;
		this.dateFin = dateFin;
		this.promotion = promotion;
		this.semestre = semestre;
		this.listeJours = null;
	}

	public Promotion getPromotion() {
		return promotion;
	}

	public void setPromotion(Promotion promotion) {
		this.promotion = promotion;
	}

	public Semestre getSemestre() {
		return semestre;
	}

	public void setSemestre(Semestre semestre) {
		this.semestre = semestre;
	}

	public Collection<Jours> getListeJours() {
		return listeJours;
	}

	public void setListeJours(Collection<Jours> listeJours) {
		this.listeJours = listeJours;
	}

	public Jours getDateDebut() {
		return dateDebut;
	}

	public void setDateDebut(Jours dateDebut) {
		this.dateDebut = dateDebut;
	}

	public Jours getDateFin() {
		return dateFin;
	}

	public void setDateFin(Jours dateFin) {
		this.dateFin = dateFin;
	}
	
	public int getNumPeriode() {
		return numPeriode;
	}

	public void setNumPeriode(int numPeriode) {
		this.numPeriode = numPeriode;
	}

	public synchronized void addPropertyChangeListener(PropertyChangeListener listener) {
		changeSupport.addPropertyChangeListener(listener);
	}
	
	public synchronized void removePropertyChangeListener(PropertyChangeListener listener) {
		changeSupport.removePropertyChangeListener(listener);
	}
	
	public synchronized void addVetoableChangeListener(VetoableChangeListener listener) {
		vetoableSupport.addVetoableChangeListener(listener);
	}
	
	public synchronized void removeVetoableChangeListener(VetoableChangeListener listener) {
		vetoableSupport.removeVetoableChangeListener(listener);
	} 
}
